Just change the return type of main from void to int
Code:
#include<stdio.h>
#include<math.h>
#include<limits.h>
#include<stdlib.h>
int main()
{
double pi,x,y;
pi=atan(1.0)*4.0;
printf("acos(0.5) %lf\n",acos(0.5));
printf("asin(0.5) %lf\n",asin(0.5));
printf("atan2(-2.0,1.0) %lf\n",atan2(-2.0,1.0));
printf("abs(-7) %d\n",abs(-7));
printf("ceil(-3.3) %lf\n",ceil(-3.3));
printf("exp(0.5) %lf\n",exp(0.5));
printf("fabs(-3.3) %lf\n",fabs(-3.3));
printf("floor(-3.3) %lf\n",floor(-3.3));
printf("log(0.5) %lf\n",log(0.5));
printf("log10(0.5) %lf\n",log10(0.5));
printf("pow(2.0,3.5) %lf\n",pow(2.0,3.5));
printf("%d %d\n",RAND_MAX,rand());
printf("sqrt(0.5) %lf\n",sqrt(0.5));
printf("%e\n",HUGE_VAL);
}
And cc -lm program_name.c
Now the program gives the following output
Code:
acos(0.5) 1.047198
asin(0.5) 0.523599
atan2(-2.0,1.0) -1.107149
abs(-7) 7
ceil(-3.3) -3.000000
exp(0.5) 1.648721
fabs(-3.3) 3.300000
floor(-3.3) -4.000000
log(0.5) -0.693147
log10(0.5) -0.301030
pow(2.0,3.5) 11.313708
2147483647 1804289383
sqrt(0.5) 0.707107
inf